import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/getInfo',
    method: 'post',
    contentType: 'application/json',
    data: { token }
  })
}

export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

export function getRoutes() {
  return request({
    url: '/user/getRoutes',
    method: 'post'
  })
}

export function uploadRoutes(routes) {
  return request({
    url: '/user/uploadRoutes',
    method: 'post',
    contentType: 'application/json',
    data: { routes }
  })
}

export function getUserList(param) {
  return request({
    url: '/user/getUserList',
    method: 'post',
    contentType: 'application/json',
    data: param
  })
}

export function addUser(param) {
  return request({
    url: '/user/addUser',
    method: 'post',
    contentType: 'application/json',
    data: param
  })
}

export function deleteUser(param) {
  return request({
    url: '/user/deleteUser',
    method: 'post',
    contentType: 'application/json',
    data: param
  })
}

export function updateUserRole(param) {
  return request({
    url: '/user/updateUserRole',
    method: 'post',
    contentType: 'application/json',
    data: param
  })
}


